<?php

class Autoevaluacion_Model_DbTable_ElementoCaracteristicas extends Zend_Db_Table_Abstract {
	
	protected $_name = 'elementocaracteristicas';
	protected $_primary = 'codelementocaracteristicas';
	protected $_sequence = 'seq_elementocaracteristicas';
	protected $_rowClass = 'App_Audit_Row';
    
	public function getCaracteristicasAsignadas($codelementolista, $codseccion) {
	    $select = $this->select(self::SELECT_WITH_FROM_PART)
		                ->join("elementoslista", "elementoslista.codelementolista={$this->_name}.codcaracteristica", array("texto"))
						->where("{$this->_name}.codseccionlista=?", $codseccion)
						->where("{$this->_name}.codelementolista=?", $codelementolista);
		$select->setIntegrityCheck(false);
		//Zend_Debug::dump($select->__toString());
		return $select->query()->fetchAll();
	}
	
    public function deleteAsignaciones($codelementolista, $codseccion) {
        $where = "codelementolista={$codelementolista} AND codseccionlista={$codseccion}";
        $this->delete($where);
        //$this->getAdapter()->delete($this->_name, $where);
    }
	
}//fin de la clase
